Repository navigation
feat(platform-objects): an organization sets the display decimal places of each standard unit of measure (ADR-0158 U6) - #37389
Conversation
…display decimal places for a standard unit code (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
… rule, real-stack grants suite, regenerated bundles and census Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
📓 Docs Drift CheckThis PR changes 4 package(s): 59 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 189 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9fc252d3b42e5188c4310a693e07ea4ca01e115e && git checkout 9fc252d3b42e5188c4310a693e07ea4ca01e115e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ff6f9768d2969c4f2f42819f461424965238e30f 98cbc476025ff17adedde53e62f0cb8bcdbba110 && git checkout -B drift-repro ff6f9768d2969c4f2f42819f461424965238e30f && git merge --no-ff 98cbc476025ff17adedde53e62f0cb8bcdbba110
node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head: Generated by Claude Code |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 03e453e · 2026-11-26T01:41Z The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own. |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: ① Derived judgmentsRead: card #35498 (body, every comment; amendments 7178077326, 7178144166, 7179529249), ruling record 7008551416 on #35339, ADR-0158 (U3, U6, L4, Open item 10) on
② Semver level
Changeset, sentence by sentence:
③ Boundary flagsDev deviations (os-dev-report 7179477079), each answered:
Out-of-scope finding the dev reported (
For #35490 (the reader), from this read: it must pick the row by the record's or the active organization, not "the row for the code". Under SQL push-down (Prime Directive 5): no query, id materialisation or in-app join is added; the uniqueness is a declared index and the isolation is Layer 0's predicate. Nothing to find. ④ Design judgment
Implementing files against the contract (ruling 7008551416: an organization admin may set the display decimals of any standard U1 code, in a new organization-owned setting place; L4 unchanged):
No must-fix. S1 and S2 are owed, on this PR or a named follow-up, before the changeset is consumed by the release. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…ce holds under; pin an administrator editing and clearing another's setting Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head after rework round 1:
Generated by Claude Code |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 98cbc47 · 2026-11-26T02:37Z The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own. |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: ① Derived judgmentsThis record is a fresh review of the new head. It rests on the whole-diff read made at Check-runs on this head: every run is
② Semver level
Changeset, sentence by sentence, on this head:
③ Boundary flagsDev deviations (os-dev-report 7179477079), each answered as on the earlier head: clear = delete (7178144166); N4 (nit) — Rework comment 7180963343: its three closures are each confirmed against the delta (S1 and N1 in ②, S2 in ④). Its ablation claim (the Out-of-scope finding the dev reported (
For #35490 (the reader): under SQL push-down (Prime Directive 5): the delta adds no query, id materialisation or in-app join; nor does the rest of the diff. Nothing to find. ④ Design judgment
Implementing files against the contract (ruling 7008551416; ADR-0158 L4 unchanged):
Nothing new breaks: the delta is prose in two files and added test cases in the third, and every check-run on the head is green or skipped. No must-fix and no should-fix remain. Open: N2, N3, N4, N5, all nits. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Landing · area o5-D · 2026-11-26T02:41Z · on L1 ACCEPT 7181024389 and contract review PASS 7181014432 at
State: ready + auto-merge now; on MERGED the area closes out #35498 ( |
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Fixes #35498
Refs #35339
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
@objectstack/platform-objects: new organization-owned objectsys_standard_unit_setting(ADR-0158 U6; Open item 10 option A), registered in the first manifest besidesys_unit.code: text, max 3. A format rule admits exactly theSTANDARD_UNITScodes in exact uppercase (STANDARD_UNIT_SETTING_CODE_PATTERN). Unique per organization, immutable after create.decimal_places: 0 to 12, scale 0, required.organization_idis injected.@objectstack/plugin-security:member_defaultreads it (read only).organization_admingets an explicit line: create, edit and delete. Clearing a setting is deleting its row.@objectstack/spec:sys_standard_unit_settingjoinsPLATFORM_OBJECTS_BY_PACKAGE['platform-objects'].@objectstack/cli:scripts/platform-object-tenancy-census.jsonis regenerated.Precedent:
sys_unit.decimal_places. The setting follows the same concept as an org unit's own decimal places: range 0 to 12, field history, member read, organization-admin write. The settings-key route (ADR-0144 D4'slocalization.currency) was measured and not followed, for four reasons. It is one org-wide scalar. Members read it only through a server projection. Its audit keeps hashes, not values. A per-code map would need a new settings column kind. The area approved this on claim amendments 7178077326 and 7178144166.Deviations from the first shape, all on the card (amendments 7178077326, 7178144166, 7179529249):
scalegoes there. "A member can read them" is met bymember_defaultread over the data API.DELETE_RESTRICTEDwhile any organization-owned row remains. Onlysys_unitis exempt, through the engine's own cascade. So a row with no delete would block the organization delete forever. This followssys_exchange_rate's posture: an admin deletes the setting, then the organization delete goes through. Pinned below.Why
codeis text plus a format rule, not a select. A select's option values are stored lowercase (kgm), while a unit code is stored in exact uppercase everywhere (U4). The rule's pattern is built from theSTANDARD_UNITSkeys, so a code the table gains is admitted with no second edit.First files to read, by risk:
packages/plugins/plugin-security/src/objects/default-permission-sets.ts: the twosys_standard_unit_settinglines.packages/platform-objects/src/system/sys-standard-unit-setting.object.ts: the format rule and the immutable-code rule.packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts: the tenancy posture it boots under.Two-minute check:
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/default-permission-sets.standard-unit-setting.integration.test.tsprints 15 passed. It boots a real stack under theisolatedtenancy posture. It shows each of these:sys_audit_logwith old and new values;organization_adminline, no superuser bits);PERMISSION_DENIEDon every write;DELETE_RESTRICTEDnaming this object, and succeeds once the setting is deleted.Tests
Rework round 1 (L1 7180149059, contract record 7180135740), head
98cbc47602. S1: the changeset sentence and the object's docblock now state the posture the isolation holds under (isolated;singleraises no wall,groupwalls by membership, ADR-0105 D1), and N1 says the display card #35490 will read the value. S2: new cases where an admin and an owner each change and delete a setting the other created, plus the effective-permission map (delete kept, nomodifyAllRecords). Affected tests re-run: the real-stack suite 15 passed (15), the declaration suite 14 passed (14). Ablation of theorganization_adminline toallowEdit: false, allowDelete: falseturned 8 of 15 red, the new cross-creator cases among them; restored, with the blob equal to HEAD andgit diff HEADempty.All readings below are on head
03e453e3, and the tree is byte-identical to the commit.Package suites and typecheck (under the verify lock)
@objectstack/plugin-security,src/default-permission-sets.standard-unit-setting.integration.test.ts: Test Files 1 passed (1), Tests 12 passed (12).@objectstack/platform-objects, full suite: Test Files 127 passed (127), Tests 2176 passed (2176). This includes the newsys-standard-unit-setting.object.test.ts.@objectstack/cliunit layer,src/utils/organization-ownership-inventory.test.tsandtest/connect-agent-both-halves-wire.pin.test.ts: Test Files 2 passed (2), Tests 28 passed (28). The CLI integration layer is left to CI.@objectstack/spec,src/system/constants/platform-object-names.test.ts: Test Files 1 passed (1), Tests 14 passed (14).platform-objects,plugin-security,cliandspec: run in oneset -ebatch that reached its last part, so each exited 0.platform-objectsreportscheck:test-typecheck: OK.plugin-securitysuite andtest:repoare left to CI.Ablation: the member read grant
node scripts/ablation-replace.mjschangedmember_default'ssys_standard_unit_settingline toallowRead: false. Evidence: anchor x1 → x0, blobd4a112e3→87691407.PermissionDeniedError.d4a112e3) andgit diff HEADis empty.Acceptance notes
isolatedposture. Under the defaultsingleposture no tenant wall stands, so another organization's row is visible. That is ADR-0105 D1's design, and every organization-owned object behaves the same way. The suite registerstenancy: { posture: 'isolated' }, as a deployment with organizations runs. The first run without it showed the other organization's row, which is how this was found. Thesys_unitsuite pins no cross-organization read.sys_unit. The display card Units of measure R1: show a quantity with its unit label #35490 already owes what an external member sees (comment 7030066814).Verification
Derived gate families (106 families, 212 commands) and the --ran reconciliation
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 212 commands from the tree at03e453e3. Each was run, with its exit code captured before any pipe.check-plugin-teardown-shape --self-testneeded an unshallowed clone, andcheck:skill-examples,check:dual-build-cjs-loads,check:i18n-coverageandcheck:published-readme-exportsneeded a full build. All five exited 0 aftergit fetch --unshallowand a full turbo build (122 of 122 tasks).pnpm check:platform-checklistexited 1 on one problem:areas/automation.jsoncitesFlowItemMoreMenu.tsx#FlowItemMoreMenu, a symbol theui/file no longer declares. That is the base tree's own state: this diff touches neitherui/nordocs/qa/, and the cited file is the same onorigin/main.--ranprinted: "106 derived famil(ies) accounted for — 106 run, 0 NOT-MEASURED (a DERIVED zero — all 106 recorded an exit code and none of them is 3)".Overlap check
node scripts/pm/overlap-check.mjs --branch=HEADagainst origin/main02520ab480printed "VERDICT clean exit 0". Two open PRs share a file, feat(security)!: View All and Modify All stop opening fields; viewAllFields is the one every-field bit #37371 (default-permission-sets.ts) and refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366 (platform-objects/src/plugin.ts); both merge cleanly with this branch.Not measured locally
integrationlayer,test:repo, the fullplugin-securitysuite and the repo-wide lint are left to CI.!, and Clause-② is a widening.🤖 Generated with Claude Code
Generated by Claude Code